Chapter 7
Definition of API Agents in HATS HA


The basic function of HATS HA is to detect any kind of possible hardware malfunction in the machines connected to a
network. When a hardware malfunction happens to any machine, HATS HA detects it and tries to solve the problem.

However, HATS HA itself cannot detect the possible malfunctions that may occur to a software being used on the network.
In order to let HATS HA detect such software malfunctions, a user can write his own API (Application Interface) Agents in
C language. HATS HA provides a special API link library and two groups of function calls to help the user accomplish this
task.

This chapter explains the library and function calls in detail and takes you step-by-step through the whole process of writing
your own API agents. It also provides examples to show you some actual API Agents.


7.1 Function Calls to Automatically Access HATS HA Main Menu


The first group of function calls in HATS HA help you automatically access the HATS HA main menu. Though HATS HA
provides a GUI main menu that allows you to check the status on the network, an API Agent that automatically accesses
this menu can be very convenient and helpful. For example, you can program your API Agent to bring up a status window
whenever a problem occurs so that you can immediately see what has happened.



HA_command(char *command,char *host_node_job_name)

..........HA_command("start HA","SERVER1");
..........HA_command("stop HA","SERVER1");
..........HA_command("start monitor","SERVER1");
..........HA_command("stop monitor","SERVER1");
..........HA_command("switch service","nfs");
..........HA_command("takeover service","nfs");
..........HA_command("download software","SERVER2");
..........HA_command("display HA status","SERVER1");

Table of ContentsSec. 7-1 sec. 7-2